/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.workingtimemanager.urb.entities;

import java.util.Vector;

/**
 *
 * @author CK05102
 */
public class Project {

    private final String PROJECTNAME;
    private final String PROJECTNUMBER;
    private Vector<WorkDay> days = new Vector<WorkDay>();
    private boolean active = false;

    public Project(String PROJECTNAME, String PROJECTNUMBER) {
        this.PROJECTNAME = PROJECTNAME;
        this.PROJECTNUMBER = PROJECTNUMBER;
        days.add(new WorkDay("empty", "empty", "empty", "empty"));
    }

    public String getProjectName() {
        return PROJECTNAME;
    }

    public String getProjectNumber() {
        return PROJECTNUMBER;
    }

    public Vector<WorkDay> getDays() {
        return days;
    }

    public void addDays(Vector<WorkDay> days) {
        this.days = days;
    }

    public void addDay(WorkDay day) {
        this.days.add(day);
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public WorkDay getActiveWorkDay() {
        for (WorkDay w : days) {
            if (w.isActive()) {
                return w;
            }
        }
        return null;
    }

    public WorkDay getWorkDayByName(String name) {
        for (WorkDay w : days) {
            if (w.getDATE().equals(name)) {
                return w;
            }
        }
        return null;
    }
}
